﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections.ObjectModel;

namespace System.Collections.ObjectModel
{
    public static class ObservableCollectionExtensions
    {
        public static ObservableCollection<T> Find<T>(this ObservableCollection<T> source, T element) where T:class
        {
            ObservableCollection<T> newCollection = new ObservableCollection<T>();
            foreach (T t in source)
            {
                if (t.Equals(element as T))
                {
                    newCollection.Add(t);
                }
            }

            return newCollection;
        }

    }
}
